package at.ac.tuwien.big.easyholdem.game;

import at.ac.tuwien.big.easyholdem.player.Player;
import at.ac.tuwien.big.easyholdem.poker.Cards;
import at.ac.tuwien.big.easyholdem.probsim.ProbabilitySimulator;

public class AlwaysBetting {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Player player = new Player();
		player.setStack(100);
		
		Game game = new Game(player, 10);
		
		for (int i = 0; i < 30; i++) {
			game.restart();
			player.setStack(10000000);
			System.out.println("Possible: " + game.getPossibleActions());
			game.act(Action.ANTE);
			System.out.println("Acted:" + Action.ANTE);
			System.out.println("New Potsize: " + game.getPotSize());
			System.out.println("New Stacksize: " + player.getStack());
			
			System.out.println("Hole Cards: " + game.getPlayersCards());
			System.out.println(new ProbabilitySimulator(game.getPlayersCards(), null).simulate());
			
			System.out.println("Possible: " + game.getPossibleActions());
			game.act(Action.BET);
			System.out.println("Acted:" + Action.BET);
			System.out.println("New Potsize: " + game.getPotSize());
			System.out.println("New Stacksize: " + player.getStack());
			
			System.out.println("Flop: " + game.getFlopCards());
			System.out.println(new ProbabilitySimulator(game.getPlayersCards(), game.getFlopCards()).simulate());
			
			System.out.println("Possible: " + game.getPossibleActions());
			game.act(Action.BET);
			System.out.println("Acted:" + Action.BET);
			System.out.println("New Potsize: " + game.getPotSize());
			System.out.println("New Stacksize: " + player.getStack());
			
			System.out.println("Turn: " + game.getTurnCard());
			Cards boardCards = new Cards(4);
			boardCards.addAll(game.getFlopCards());
			boardCards.add(game.getTurnCard());
			System.out.println(new ProbabilitySimulator(game.getPlayersCards(), boardCards).simulate());
			
			System.out.println("Possible: " + game.getPossibleActions());
			game.act(Action.BET);
			System.out.println("Acted:" + Action.BET);
			System.out.println("New Potsize: " + game.getPotSize());
			System.out.println("New Stacksize: " + player.getStack());
			
			System.out.println("River: " + game.getRiverCard());
			boardCards.add(game.getRiverCard());
			System.out.println(new ProbabilitySimulator(game.getPlayersCards(), boardCards).simulate());
			
			System.out.println("Possible: " + game.getPossibleActions());
			
			System.out.println("Is over: " + game.isOver());
			
			System.out.println("Player won: " + game.getShowdownResult().hasPlayerWon());
			System.out.println("Is split pot: " + game.getShowdownResult().isSplitPot());
			System.out.println("Player: " + game.getShowdownResult().getPlayersHandRank());
			System.out.println("Dealer: " + game.getShowdownResult().getDealersHandRank());		
		}
	}

}
